// let beforeCpu = Game.cpu.getUsed();
// console.log(Game.cpu.getUsed() - beforeCpu);
const {EnumRole, EnumBehavior} = require("./Enum");
Object.memory={
    role: "attack",
    behavior: 0,
    behaviorId:11,
    replenish:0,
    replenishId:11,
    isBehavior:false,
    createRoom: null,
    workRoom: null,
}
Game.spawns["RedJun1"].createCreep([...Array(6).fill(CARRY),...Array(6).fill(WORK),...Array(6).fill(MOVE)],"engine",{
    role: "engine",
    behavior: 0,
    createRoom: null,
    workRoom: null,
})

Game.spawns["BLACKJUN"].createCreep([...Array(5).fill(TOUGH),...Array(10).fill(MOVE),...Array(5).fill(MOVE),...Array(5).fill(ATTACK)],"tempAttack2",{
    role: "attack",
    behavior: 0,
    createRoom: null,
    workRoom: null,
})

for (let order of Game.market.getAllOrders(order => order.resourceType === RESOURCE_UTRIUM && order.type === ORDER_BUY && Game.market.calcTransactionCost(100, "E4S48", order.roomName) < 50)) {
    console.log(order.id+":"+order.resourceType+":"+order.amount+"->buy"+":"+order.price);
}
for (let order of Game.market.getAllOrders(order => order.resourceType === RESOURCE_UTRIUM && order.type === ORDER_SELL && Game.market.calcTransactionCost(100, "E4S48", order.roomName) < 30)) {
    console.log(order.id+":"+order.resourceType+":"+order.amount+"->sell"+":"+order.price);
}
Object.values(Game.market.getOrderById("6836a62670d16c00126aa4a5"))
Game.market.deal('681e803370d16c00129600d5', 100, 'E4S49');